import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/custom_model_list_entity.dart';

CustomModelListEntity $CustomModelListEntityFromJson(
    Map<String, dynamic> json) {
  final CustomModelListEntity customModelListEntity = CustomModelListEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    customModelListEntity.total = total;
  }
  final List<CustomModelListRows>? rows = (json['rows'] as List<dynamic>?)
      ?.map(
          (e) =>
      jsonConvert.convert<CustomModelListRows>(e) as CustomModelListRows)
      .toList();
  if (rows != null) {
    customModelListEntity.rows = rows;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    customModelListEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    customModelListEntity.msg = msg;
  }
  return customModelListEntity;
}

Map<String, dynamic> $CustomModelListEntityToJson(
    CustomModelListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['rows'] = entity.rows?.map((v) => v.toJson()).toList();
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  return data;
}

extension CustomModelListEntityExtension on CustomModelListEntity {
  CustomModelListEntity copyWith({
    int? total,
    List<CustomModelListRows>? rows,
    int? code,
    String? msg,
  }) {
    return CustomModelListEntity()
      ..total = total ?? this.total
      ..rows = rows ?? this.rows
      ..code = code ?? this.code
      ..msg = msg ?? this.msg;
  }
}

CustomModelListRows $CustomModelListRowsFromJson(Map<String, dynamic> json) {
  final CustomModelListRows customModelListRows = CustomModelListRows();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    customModelListRows.createTime = createTime;
  }
  final CustomModelListRowsParams? params = jsonConvert.convert<
      CustomModelListRowsParams>(json['params']);
  if (params != null) {
    customModelListRows.params = params;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    customModelListRows.id = id;
  }
  final String? modelName = jsonConvert.convert<String>(json['modelName']);
  if (modelName != null) {
    customModelListRows.modelName = modelName;
  }
  final String? modelConfig = jsonConvert.convert<String>(json['modelConfig']);
  if (modelConfig != null) {
    customModelListRows.modelConfig = modelConfig;
  }
  final String? deviceId = jsonConvert.convert<String>(json['deviceId']);
  if (deviceId != null) {
    customModelListRows.deviceId = deviceId;
  }
  return customModelListRows;
}

Map<String, dynamic> $CustomModelListRowsToJson(CustomModelListRows entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['modelName'] = entity.modelName;
  data['modelConfig'] = entity.modelConfig;
  data['deviceId'] = entity.deviceId;
  return data;
}

extension CustomModelListRowsExtension on CustomModelListRows {
  CustomModelListRows copyWith({
    String? createTime,
    CustomModelListRowsParams? params,
    String? id,
    String? modelName,
    String? modelConfig,
    String? deviceId,
  }) {
    return CustomModelListRows()
      ..createTime = createTime ?? this.createTime
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..modelName = modelName ?? this.modelName
      ..modelConfig = modelConfig ?? this.modelConfig
      ..deviceId = deviceId ?? this.deviceId;
  }
}

CustomModelListRowsParams $CustomModelListRowsParamsFromJson(
    Map<String, dynamic> json) {
  final CustomModelListRowsParams customModelListRowsParams = CustomModelListRowsParams();
  return customModelListRowsParams;
}

Map<String, dynamic> $CustomModelListRowsParamsToJson(
    CustomModelListRowsParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension CustomModelListRowsParamsExtension on CustomModelListRowsParams {
}